package com.hyq.abstractfactory.example;

import java.security.AlgorithmConstraints;

/**
 * 客户端
 * @author Janus
 */
public class Client {

	public static void main(String[] args) throws Exception {
		//创造男性
		HumanFactory mhf= new MaleFactory();
		
		//创造女性
		HumanFactory fhf= new FemaleFactory();
		//黄色人种-男人
		Human yellowMale = mhf.createYellowHuman();
		yellowMale.getSex();
		yellowMale.getColor();
		yellowMale.talk();
		//黄色人种-女人
		Human yellowFemale = fhf.createYellowHuman();
		yellowFemale.getColor();
		yellowFemale.getSex();
		yellowFemale.talk();
		System.out.println("-----------分割线----------");
		//白人-男性
		Human whiteMale = mhf.createWhiteHuman();
		whiteMale.getColor();
		whiteMale.getSex();
		whiteMale.talk();
		//白人-女性
		Human whiteFemale = fhf.createWhiteHuman();
		whiteFemale.getColor();
		whiteFemale.getSex();
		whiteFemale.talk();
		
	}
}
